package com.study.myteach.桥接模式.pack1;

import com.study.myteach.组合模式.IShape;

import java.util.ArrayList;

/**
 * @author lk
 * @date 2021/4/3 0003 15:30
 * @description:
 */
public class CompositeShape extends AbsShape {
    private ArrayList<IShape> list = new ArrayList<>();

    public void add(IShape iShape) {
        list.add(iShape);
    }

    @Override
    public void draw() {
        for (IShape iShape : list) {
            iShape.draw();
        }
    }
}
